<template>
  <div class="mosk" v-if="dialog">
    <div class="warning">
      <span class="close pointer" @click="close"></span>
      <div class="text">
        <h2>温馨提示</h2>
        <p>{{text}}</p>
      </div>
      <div class="footer">
        <div class="btn_group">
          <img
            @click="close"
            class="first pointer"
            src="~@/assets/img/typing_game/cancel.png"
            alt=""
          />
          <img
            @click="confirm"
            class="secend pointer"
            src="~@/assets/img/typing_game/confirm.png"
            alt=""
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props:{
    text:{
      type:String,
      default:'闯关再次失败需要扣除1个学币'
    },
    dialog:{
      type:Boolean,
      default:false
    }
  },
  data() {
    return {
    };
  },
  methods: {
    close() {
      console.log('取消');
      this.$emit("closeEvent")
    },
    confirm(){
      console.log("确定");
      this.$emit("confirmEvent")
    }
  },
};
</script>

<style lang="scss" scoped>
.pointer{
  cursor: pointer;
}
.mosk {
  z-index: 99999;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  .warning {
    position: relative;
    top: 0;
    left: 0;
    width: 581px;
    height: 317px;
    background: url("~@/assets/img/typing_game/warning_box.png");
    background-size: 100% 100%;
    .close {
      position: absolute;
      top: -32px;
      right: -18px;
      width: 84px;
      height: 86px;
      background: url("~@/assets/img/typing_game/close_dialog.png");
      background-size: 100% 100%;
    }
    .text {
      padding-top: 60px;
      color: #a05951;
      text-align: center;
      h2{
        font-size: 30px;
        font-weight: 900;
        letter-spacing: 3px;
      }
      p{
        line-height: 60px;
        font-size: 20px;
        font-weight: 400;
      }
    }
    .footer {
      display: flex;
      justify-content: center;
      padding-top: 55px;
      .btn_group {
        position: absolute;
        bottom: 25px;
        display: flex;
        justify-content: space-between;
        width: 420px;
        img {
          width: 178px;
          height: 72px;
        }
      }
    }
  }
}
</style>
